proc createnetwork {chid server} {
	global n_conns
	global CHANS_$chid
	array set CHANS_$chid {}
	
	set frname [ttk::notebook $n_conns.$chid]
	puts $frname
	createoutput $frname.console [tr Console] $chid
	
	$n_conns insert end $frname -text "$server"
	set idx [expr [$n_conns index end] - 1]
	
	$n_conns select $idx
}

proc closealltabs {id} {
	foreach tab [$id tabs] {
		puts $tab
		if { "$tab" != "$id.console" } {
			$id forget $tab
			destroy $tab
		}
	}
}
